using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace DynamicGeneration.Modules.WebApiExplorer
{
    public class WebApiMethodInfo
    {
        public MethodInfo MethodInfo { get; set; }
        public List<AttributeInfo> Attributes { get; set; }
        public string Name { get { return MethodInfo.Name; } }

        public WebApiMethodInfo(MethodInfo methodInfo)
        {
            // TODO: Complete member initialization
            MethodInfo = methodInfo;
            Attributes = (from item in Attribute.GetCustomAttributes(MethodInfo)
                          select new AttributeInfo(item)).ToList<AttributeInfo>();
        }
    }
}
